<template>
    <div>
        <van-nav-bar
        border
        title="零钱提现"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
        />
        <div class="content">
            <div class="content_main">
                <div><van-cell title="到账银行卡" center value="银行卡号:88888888" is-link/></div>
                
            </div>
            <div class="input">
                <div style="margin:20px">到账金额</div>
                <van-field v-model="number" 
                type="number" center label="￥" />
                 <div style="margin:20px;color:#bbb">剩余金额&nbsp;￥&nbsp;
                     <span>{{customerById.money}}</span>
                 </div>
                <van-button color="#ededed" type="default" round block @click="invest">提现</van-button>
            </div>
        </div>
    </div>
</template>
<script>
import {mapActions, mapState} from 'vuex'
import { Toast } from 'vant';
export default {
    data(){
        return{
            number:''
        }
    },
    created(){
        this.toFindCustomer();
    },
    computed:{
        ...mapState('money',['customerById']),
        ...mapState('login',['userInfo'])
    },
    methods:{
        ...mapActions('money',['findCustomer']),
        onClickLeft(){
            this.$router.push({path:'money'})
        },
        invest(){
            if(this.number!==''){
                Toast('提现中...');
                this.$router.push({path:'money'})
            }else{
                Toast('请输入充值的值！');
            }
            
        },
        toFindCustomer(){
            let id = localStorage.getItem('id')
            this.findCustomer(id);
        }
    }
}
</script>
<style scoped>
.content{
    width: 100%;
    height: 400px;
    overflow: hidden;
}
.content_main{
    width: 100%;
    height: 142px;
    background-color: #f1f1f1;
    overflow: hidden;

}
.content_main>div{
    margin-top: 42px;
}
.van-cell.van-cell--clickable{
    background-color: transparent;
}
.input{
    width: 100%;
    height: 142px;
}
.van-cell.van-field{
    margin-top: 40px;
    font-size: 20px;
    margin-bottom: 30px;
}
.content div:last-child{
    color: black;
}
</style>